home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 June: Reference Library / Dev.CD Jun 94.toast / Periodicals / develop / develop Issue 5 / develop 5 code / Lisp Mini-App / Program / default-handlers.lisp < prev    next >
Encoding:
Text File  |  1992-04-08  |  2.7 KB  |  105 lines  |  [TEXT/CCL2]

  1. #|
  2.    default-handlers.lisp
  3.  
  4.    Defines the default Event Handlers used in the Mini-Application
  5.    sample program.
  6.  
  7.    This file effectively defines the HyperCard-like protocols and
  8.    null behavior for the Mini-Application's windows, and its palettes'
  9.    items. The HyperTalk-like scripts must be added by the user.
  10.  
  11.    All objects have default handlers that do nothing, except
  12.    for the window’s idle handler, which simply passes the
  13.    idle event to objects in its window.
  14.  
  15.    Note that the mouse-down method for draw-items is over-ridden 
  16.    in the example application in mini-app-example.lisp.
  17.  
  18.    For further info, see files "About Mini-App" and "Instructions".
  19.  
  20.  
  21.    Copyright 1990, 1991 by Ruben Kleiman for Apple Computer, Inc.
  22.  
  23.    Change History.
  24.    03-12-92 slm  Updated file header comments.
  25.  
  26. |#
  27.  
  28. ;;; _______________________________________________________________________________
  29. ;;; Default Window handlers
  30.  
  31. ;;; Called whenever the mouse enters the window
  32. (defmethod mouse-enter ((window draw-dialog) where)
  33.   (declare (ignore where))
  34.   )
  35.  
  36. ;;; Called whenever the mouse is within the window
  37. (defmethod mouse-within ((window draw-dialog) where)
  38.   (declare (ignore where))
  39.   )
  40.  
  41. ;;; Called whenever the mouse leaves the window
  42. (defmethod mouse-leave ((window draw-dialog) where)
  43.   (declare (ignore where))
  44.   )
  45.  
  46. (defmethod key ((window draw-dialog) char)
  47.   (declare (ignore char))
  48.   )
  49.  
  50. (defmethod mouse-down ((window draw-dialog) where)
  51.   (declare (ignore where))
  52.   )
  53.  
  54. (defmethod mouse-up ((window draw-dialog) where)
  55.   (declare (ignore where))
  56.   )
  57.  
  58. ;;; This is the default idle handler for a draw-dialog window
  59. (defmethod idle ((window draw-dialog))
  60.   (dolist (item (slot-value window 'my-items))
  61.     (idle item)))
  62.  
  63.  
  64. ;;; _________________________________________________________________________________
  65. ;;; Default draw-item handlers
  66. ;;;
  67. ;;;   The default handlers do nothing.
  68.  
  69. ;;; Called whenever the mouse enters the draw-item
  70. (defmethod mouse-enter ((item draw-item) where)
  71.   (declare (ignore where))
  72.   )
  73.  
  74. ;;; Called whenever the mouse is within the draw-item
  75. (defmethod mouse-within ((item draw-item) where)
  76.   (declare (ignore where))
  77.   )
  78.  
  79. ;;; Called whenever the mouse leaves the draw-item
  80. (defmethod mouse-leave ((item draw-item) where)
  81.   (declare (ignore where))
  82.   )
  83.  
  84. (defmethod key ((item draw-item) char)
  85.   ;; Pass newline to editable text box
  86.   (if (char= char #\NewLine)
  87.     (view-key-event-handler item char))
  88.   )
  89.  
  90. (defmethod mouse-down ((item draw-item) where)
  91.   (declare (ignore where))
  92.   (dialog-item-action item)
  93.   )
  94.  
  95. (defmethod mouse-up ((item draw-item) where)
  96.   (declare (ignore where))
  97.   )
  98.  
  99. ;;; This is the default idle handler for a draw-item
  100. (defmethod idle ((item draw-item))
  101.   )
  102.  
  103. ;end of file default-handlers.lisp
  104. ;------------------------------------------------
  105.